package xyz.jcat.web.security;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

public class UserDetailsImpl implements UserDetails {

    private Long id;
    private String account;
    private String password;
    private List<Long> roles;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return this.password;
    }

    @Override
    public String getUsername() {
        return this.getUsername();
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }

    public UserDetailsImpl(Long id, String account, String password, List<Long> roles) {
        this.id = id;
        this.account = account;
        this.password = password;
        this.roles = roles;
    }

    public Long getId() {
        return id;
    }

    public String getAccount() {
        return account;
    }

    public List<Long> getRoles() {
        return roles;
    }
}
